<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>维保新增</title>
	<meta name="viewport"  content="width=device-width, initial-scale=1">
	<link rel="stylesheet" type="text/css" href="${path}/resource/plugins/bootstrap/css/bootstrap.min.css">
  	<link rel="stylesheet" type="text/css" href="${path}/resource/css/ysrmain.css">
	
	<link rel="stylesheet" href="${path}/resource/css/gzfx.css">
	<link rel="stylesheet" href="${path}/resource/css/allEquipment.css">

	
	<script src="${path}/resource/plugins/jQuery/jquery-2.2.3.min.js"></script>
	
	<script type="text/javascript" src="${path}/resource/plugins/bootstrap/js/bootstrap.min.js"></script>

	<script type="text/javascript" src="${path}/resource/js/echarts.min.js"></script>	
	<script type="text/javascript"></script>
</head>
<body>
	
	<!-- 头部 -->
	<!-- 开始 -->
	<jsp:include page="../allEquip/top_nav.jsp"></jsp:include>
	<!-- 头部结束 -->
    <!-- 右侧内容区域 -->
    <div class="right-content  container-fluid">
    	<div class="row">
    		<div class=" row right-nav">
	    			<div class="title-name">
	    				<span>变频器维保记录统计</span>
	    				
	    			</div>
	    			<div class=" right nav-over padding-r-1  ">
	    					<a href="${path}/manage/redirect/faultInfo/record" class="add-btn">新增</a>
	    				      <button class=" search-btn float-r" type="button" onclick="attrYemaSearch();"></button>
					      <input id="require" type="text" placeholder="序列号、型号、或城市" class="back-m1 search-input float-r search back-m1">					      											
	    			</div>	    			
	    	</div>	
		  
		

		  <!-- Table -->
		  <div class="table-div content-img">
			  <table id="listtable" class="table table-striped">
			  	  <tr>
			  	  	  <th>记录编号</th>
					  <th>变频器序列号</th>
					  <th>设备型号</th>
					  <th>所在城市</th>
					  <th>闭环</th>
				  </tr>
				  <tr>
				  	  <td>1</td>
					  <td><a class="color-w" href="<%=path%>/manage/redirect/allEquip/faultAnalysis?serialNum=0181413c">0181413c</a></td>
					  <td>设备型号1</td>
					  <td>珠海市</td>
					  <td>是</td>
				  </tr>
				  <tr>
				  	  <td>2</td>
					  <td><a class="color-w" href="<%=path%>/manage/redirect/allEquip/faultAnalysis?serialNum=0181413c">0181413c</a></td>
					  <td>设备型号2</td>
					  <td>珠海市</td>
					  <td>是</td>
				  </tr>
				  <tr>
				  	  <td>3</td>
					  <td><a class="color-w" href="<%=path%>/manage/redirect/allEquip/faultAnalysis?serialNum=0181413c">0181413c</a></td>
					  <td>设备型号3</td>
					  <td>珠海市</td>
					  <td>是</td>
				  </tr>
				  <tr>
				  	  <td>4</td>
					  <td><a class="color-w" href="<%=path%>/manage/redirect/allEquip/faultAnalysis?serialNum=0181413c">0181413c</a></td>
					  <td>设备型号4</td>
					  <td>珠海市</td>
					  <td>是</td>
				  </tr>				  
			  </table>
		  </div>
		  <!-- 分页 -->
		  <div id="fenye" class="pagers">
		  	<nav class="float-r padding-3">
		  	  <ul class="pagination">
		  	    <li id="goPrev"><a href="javascript:void(0);">&laquo;</a></li>
			    <li id="firstyema" class="active yema"><a href="javascript:void(0);">1</a></li>
<!-- 			    <li class="yema"><a href="javascript:void(0);">2</a></li> -->
<!-- 			    <li class="yema"><a href="javascript:void(0);">3</a></li> -->
<!-- 			    <li class="yema"><a href="javascript:void(0);">4</a></li> -->
<!-- 			    <li class="yema"><a href="javascript:void(0);">5</a></li> -->
			    <li id="goNext"><a href="javascript:void(0);">&raquo;</a></li>
		  	  </ul>
		  	</nav>
		  </div>
		</div>
	 
   </div>

	


	
</body>
<script type="text/javascript">
$(function(){
	/* $(".menu-left").children("dl").eq(2).children("dd").eq(1).addClass("dl-active");  */
	$(".img-gzxx").parent().css({"color":"#82d1e8","text-shadow":" 0px 0px 10px #b7d6df"});
	$(".img-gzxx").attr("src",'${path}/resource/images/gzxx2.png')
	$(".img-gzxx").parent().parent().addClass("dl-active");
	$(".img-gzxx").parent().parent().css("padding","5px 0px");
	$(".img-wbxz").attr("src","${path}/resource/images/wbxz2.png")
	$(".img-wbxz").parent().css({"color":"#82d1e8","text-shadow":" 0px 0px 10px #b7d6df"});
	$(".img-wbxz").removeClass('padding-1');
	
	attrYemaSearch();
})

var size = 1;
var curPageNO = 1;
function search() {
	$.ajax({
		type : 'POST',
		url : '<%=path%>/manage/managerMatainMana',
		data : {
			require : $("#require").val(),
			pageSize : 10,
			curPageNO : curPageNO
		},
		dataType : 'json',
		async : false,
		success : function(result) {
			if(result.status == "OK") {
				$('#listtable').text('');
				var html = "<tr><th>记录编号</th><th>变频器序列号</th><th>设备型号</th><th>所在城市</th><th>闭环</th></tr>";
				if(result.data.list == "[null]") {
					
				} else {
					size = result.data.size;
					var list = eval("(" + result.data.list + ")");
					$.each(list, function(i){
						var href = "<%=path%>/manage/redirect/allEquip/faultAnalysis?serialNum="+list[i].serialNum;
						html += '<tr><td>'+list[i].id +
								'</td><td><a class="color-w" href='+href+'>'+list[i].serialNum +
								'</a></td><td>'+list[i].powerLevelType +
								'</td><td>'+list[i].cityArea +
								'</td><td>'+list[i].soluted + '</td></tr>';
					});
				}
				$('#listtable').append(html);
			}
		},
		error : function() {
			//alert("系统错误！");
		}
	})
}
//点击页码
function attrYemaSearch() {
	curPageNO = 1;
	search();
	//$('.pagination').html('');
	$('.pagination').html('<li id="goPrev"><a href="javascript:void(0);">&laquo;</a></li>'+
	    '<li id="firstyema" class="active yema"><a href="javascript:void(0);">1</a></li>'+
	    '<li id="goNext"><a href="javascript:void(0);">&raquo;</a></li>');
	if(size > 10) {
		var html = '';
		var yemaToal = (size/10)+1;
		for(var i=2; i<yemaToal; i++) {
			html += '<li class="yema"><a href="javascript:void(0);">'+i+'</a></li>'
		}
		$('#firstyema').after(html);
	}
	attrYeMa();
}
function attrYeMa() {
	$('.yema').click(function() {
		$('.yema').removeClass("active");
		$(this).addClass("active");
		curPageNO = $(this).children('a').text();
		search();
	});
	$('#goPrev').click(function() {
		var prevyema = $(this).nextAll('.active').prev('.yema');
		if(prevyema != null && prevyema.length > 0) {
			$(this).nextAll('.active').removeClass("active");
			prevyema.addClass("active");
			curPageNO = prevyema.children('a').text();
			search();
		}
	});
	$('#goNext').click(function() {
		var nextyema = $(this).prevAll('.active').next('.yema');
		if(nextyema != null && nextyema.length > 0) {
			$(this).prevAll('.active').removeClass("active");
			nextyema.addClass("active");
			curPageNO = nextyema.children('a').text();
			search();
		}
	});
}
</script>
</html>